package com.yxwl.demo.utils;


public class StringUtil {

    public static boolean isSpace(String s) {
        return (s == null || s.trim().length() == 0);
    }


    public static String bytetToHex(byte[] bs) {
        if (bs==null)return "";
        char[] chars = "0123456789ABCDEF".toCharArray();
        StringBuilder sb = new StringBuilder(2 * bs.length);
        int bit;
        for (byte b : bs) {
            sb.append(" 0x");
            bit = (b & 0x0f0) >> 4;
            sb.append(chars[bit]);
            bit = b & 0x0f;
            sb.append(chars[bit]);
        }
        return sb.toString().trim();
    }

}
